home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
A-COMAL Series
/
(k)aal.d64
/
proc.print'using
< prev
next >
Wrap
Text File
|
2007-02-28
|
2KB
|
69 lines
0410 ╨╥╧├ PRINT'USING(FMT$,NUMBER) ├╠╧╙┼─
0420 ─╔═ NBR$ ╧╞ 20
0430 FLOAT:=╞┴╠╙┼
0440 ╔╞ FMT$(1)="$" ╘╚┼╬ FLOAT:=╘╥╒┼
0450 ╔╞ "." ╔╬ FMT$ ╘╚┼╬
0460 DECIMALS:=╠┼╬(FMT$)-("." ╔╬ FMT$)
0470 NUMBER:=NUMBER*(10^DECIMALS)
0480 ┼╠╙┼
0490 DECIMALS:=0
0500 ┼╬─╔╞
0510 NUMBER:=NUMBER+.5
0520 NUMBER:=╔╬╘(NUMBER)
0530 NBR$:=╙╘╥$(NUMBER)
0540 ╔╞ DECIMALS ╘╚┼╬
0550 ╔╞ NUMBER=0 ╘╚┼╬
0560 ╞╧╥ I:=1 ╘╧ DECIMALS ─╧
0570 NBR$:+"0"
0580 ┼╬─╞╧╥ I
0590 ┼╬─╔╞
0600 ╔╞ ╠┼╬(NBR$)<DECIMALS ╘╚┼╬
0610 TMP$:=""
0620 ╞╧╥ I:=1 ╘╧ DECIMALS-╠┼╬(NBR$) ─╧
0630 TMP$:+"0"
0640 ┼╬─╞╧╥ I
0650 TMP$:+NBR$
0660 NBR$:=TMP$
0670 ┼╬─╔╞
0680 POINT:=╠┼╬(NBR$)-DECIMALS
0690 TMP$:=NBR$(1:POINT)
0700 NBR$:=TMP$+"."+NBR$(POINT+1:╠┼╬(NBR$))
0710 ┼╬─╔╞
0720 LF:=╠┼╬(FMT$)
0730 LN:=╠┼╬(NBR$)
0740 C:=0
0750 ╞╧╥ I:=1 ╘╧ LF ─╧
0760 ╔╞ FMT$(I)="," ╘╚┼╬ C:+1
0770 ┼╬─╞╧╥ I
0780 ╔╞ LN>LF-C ╘╚┼╬
0790 ╨╥╔╬╘ FMT$,
0800 ┼╠╙┼
0810 J:=0
0820 C:=0
0830 S:=0
0840 ╔╞ ╬╧╘ (DECIMALS) ╘╚┼╬ S:=1
0850 ╞╧╥ I:=LN ╘╧ 1 ╙╘┼╨ -1 ─╧
0860 ╔╞ S ╘╚┼╬
0870 ╔╞ NBR$(I)<>"-" ╘╚┼╬ C:+1
0880 ╔╞ C=4 ╘╚┼╬
0890 FMT$(LF-J):=","
0900 J:+1
0910 C:=1
0920 ┼╬─╔╞
0930 ┼╬─╔╞
0940 FMT$(LF-J):=NBR$(I)
0950 ╔╞ NBR$(I)="." ╘╚┼╬ S:=1
0960 J:+1
0970 ┼╬─╞╧╥ I
0980 ╞╧╥ I:=LF-J ╘╧ 1 ╙╘┼╨ -1 ─╧
0990 ╔╞ FLOAT ╘╚┼╬
1000 FMT$(I):="$"
1010 FLOAT:=╞┴╠╙┼
1020 ┼╠╙┼
1030 FMT$(I):=" "
1040 ┼╬─╔╞
1050 ┼╬─╞╧╥ I
1060 ╨╥╔╬╘ FMT$,
1070 ┼╬─╔╞
1080 ┼╬─╨╥╧├ PRINT'USING